<?php
/** 初始化项目 */
require '../../app/app.php';
/** 初始化数据库 */
use app\util\Mysql;
$database = Mysql::init();

if (isset($_SESSION['username']) && $_SESSION['username'] != "") {
    $oldtime=time();
    $oldtime=$oldtime-31536000;
    $database->delete("user_login_info", ["logintime[<]" => $oldtime]);
    $out = array('code' => '1', "msg" => "删除成功。", "count" => "", "data" => "");
    echo json_encode($out);
} else {
    $out = array('code' => '1', "msg" => "请先登录", "count" => "", "data" => ""); //定义返回数组
    echo json_encode($out);
}
?>

